package com.example.douyinproject.me;
/*
 * @Description:
 * @Author: 山志凯
 * @Date: 2021-07-02
 * @Time: 00:34
 */

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.example.douyinproject.R;

public class PersonalHomePage extends Activity {
    ImageView login_out;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.personalhomepage);
        login_out = findViewById(R.id.iv_login_out);
        login_out.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                AlertDialog.Builder builder = new AlertDialog.Builder(PersonalHomePage.this);
                builder.setTitle("点错了吧").setMessage("您确定要退出登录吗？")
                        .setIcon(R.mipmap.icon)
                        .setNegativeButton("取消",null)
                        .setPositiveButton("确定", new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialog, int which) {
                                Intent intent = new Intent(PersonalHomePage.this, MeFragment.class);
                                startActivity(intent);
                            }
                        });
                builder.create().show();
            }
        });
    }
}
